package cn.hrlly.tao2shou.presenter;

import cn.hrlly.tao2shou.biz.RequireDetailsBiz;
import cn.hrlly.tao2shou.biz.RequireDetailsBizImpl;
import cn.hrlly.tao2shou.domain.Require;
import cn.hrlly.tao2shou.domain.Requires;
import cn.hrlly.tao2shou.listener.OnRequireDetailsListener;
import cn.hrlly.tao2shou.view.view_interface.RequireDetailsView;

/**
 * User: gengliang
 * Date: 2016-01-30
 * Time: 10:43
 */

public class RequireDetailsPresenterImpl implements RequireDetailsPresenter,OnRequireDetailsListener {

    private RequireDetailsBiz requireDetailsBiz;
    private RequireDetailsView requireDetailsView;

    public RequireDetailsPresenterImpl(RequireDetailsView requireDetailsView){
        this.requireDetailsBiz=new RequireDetailsBizImpl(this);
        this.requireDetailsView=requireDetailsView;
    }

    @Override
    public void showRequireDetails() {
        Requires requires=new Requires();
        requires.setRequireId(requireDetailsView.getRequireId());
        requireDetailsBiz.getNetRequireDetails(requires);
    }

    @Override
    public void showRequireDetailsSucc(Require require) {
        requireDetailsView.showRequireDetails(require);
    }

    @Override
    public void showRequireDetailsFail(String errorMessage) {
        requireDetailsView.showMessage(errorMessage);
    }

    @Override
    public void showRequireDetailsFail(int errorMessage) {
        requireDetailsView.showMessage(errorMessage);
    }
}
